package edu.hitsz.prop;

import edu.hitsz.aircraft.HeroAircraft;
import edu.hitsz.shootStrategy.ShootDirect;
import edu.hitsz.shootStrategy.ShootRing;
import edu.hitsz.shootStrategy.ShootStrategy;

public class BulletPlusProp extends AbstractProp{

    public BulletPlusProp(int locationX, int locationY, int speedX, int speedY) {
        super(locationX, locationY, speedX, speedY);
    }

    @Override
    public void propAction() {
        System.out.println("FireSupply active!");
        HeroAircraft heroAircraft=HeroAircraft.getInstance();
        heroAircraft.setShootStrategy(new ShootRing());

        try {
            Thread.sleep(5000);
            heroAircraft.setShootStrategy(new ShootDirect());
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
